#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
string a;
ll n, t;
int main() {
    cin >> n >> t;
    cin >> a;
    int mul = 1;
    while (mul < n) {
        mul *= 2;
    }
    t %= mul;
    while (t--)
        for (int i = a.size() - 1; i >= 1; i--)
            a[i] = ((a[i - 1] - '0') ^ (a[i] - '0')) + '0';

    cout << a;

    return 0;
}